<?php
Class commentController Extends baseController {

	public function index(){}
	public function insert(){
			date_default_timezone_set("Asia/Bangkok");
			$comment = new comment();
			$comment->tendangnhap = $_SESSION['user']->TenDangNhap;
			$comment->tivi_id = $_REQUEST['tivi_id'];
			$comment->parent_id = $_POST['parent_id'];
			$comment->noidung = trim($_POST['comment']);
			$comment->thoigian = date('Y-m-d G:i:s');
			$comment->trangthai = 0;
			
			$rs = $comment->insert($comment);
			
			if($rs){
				echo '1';
				die;
				
			}
			else{
				echo '0';
				die;
				
			}
		}
		
		
}
?>
